<?php include COMMON_PATH.'/index/header.html' ?>
<!--考试回顾-->

<style>
    [v-cloak]{
        display: none;
    }
</style>
<div class="home-bot-wrap main-content question-wrap clearfix">
    <div class="title clearfix">
        <?=$results['info']?>
        <span class="fl"><?=$results['name']?>（共<?=count($results['lists'])?>题） 考试时间：<?=$results['createtime']?> </span>
        <span class="fr">正确：<i class="yes"><?=$results['correct']?></i>&nbsp;&nbsp;错误：<i class="no"><?=$results['total'] - $results['correct']?></i>&nbsp;&nbsp;排名：<?=$results['ranking']?>（共<?=$results['number']?>人）</span>
    </div>
    <div class="as-wrap rv-wrap">
        <ul class="question-list-wrap">
            <?php foreach($results['lists'] as $k=>$v):?>
            <li>
                <div class="questions-item clearfix">
                    <div >
                        <span class="num-now-wrap fl">
                            <?=$k+1?>、
                        </span>
                    </div>
                    <?php $q_correct = explode(',',$v['q_correct'])?>
                    <?php $m_correct = explode(',',$v['m_correct'])?>
                    <p class="question"><?=$v['topic']?>
                        <?php if($v['type'] == 2):?>
                            (多选题)
                        <?php else:?>
                            (单选题)
                        <?php endif;?>
                        &nbsp;&nbsp;你选择的:<?php if($m_correct[0] == 1):?>A<?php endif;?><?php if($m_correct[0] == 2 || $m_correct[1] == 2):?>B<?php endif;?><?php if($m_correct[0] == 3 || $m_correct[1] == 3 || $m_correct[2] == 3):?>C<?php endif;?><?php if($m_correct[0] == 4 || $m_correct[1] == 4 || $m_correct[2] == 4 || $m_correct[3] == 4):?>D<?php endif;?>
                        <?php if($v['q_correct'] == $v['m_correct']):?>
                        <span class="user-selected"><i>(正确)</i></span>
                        <?php else:?>
                        <span class="user-selected wrong"><i>(错误)</i></span>
                        <?php endif;?>
                        &nbsp;&nbsp;正确答案:<?php if($q_correct[0] == 1):?>A<?php endif;?><?php if($q_correct[0] == 2 || $q_correct[1] == 2):?>B<?php endif;?><?php if($q_correct[0] == 3 || $q_correct[1] == 3 || $q_correct[2] == 3):?>C<?php endif;?><?php if($q_correct[0] == 4 || $q_correct[1] == 4 || $q_correct[2] == 4 || $q_correct[3] == 4):?>D<?php endif;?>
                    </p>
                </div>

                <?php if(($q_correct[0] == 1) && ($m_correct[0] == 1)):?>
                    <div class="option-item activeA  clearfix" data-eq="1" data-option="A">
                        <span class="layui-icon right">&#xe605;</span>
                        <p class="option-text"><?=$v['option_a']?></p>
                    </div>
                <?php else:?>
                    <?php if($m_correct[0] == 1):?>
                        <div class="option-item activeW  clearfix" data-eq="1" data-option="A">
                            <span class="layui-icon wrong">&#x1006;</span>
                            <p class="option-text"><?=$v['option_a']?></p>
                        </div>
                    <?php else:?>
                        <div class="option-item clearfix" data-eq="1" data-option="A">
                            <span class="option-serial">A、</span>
                            <p class="option-text"><?=$v['option_a']?></p>
                        </div>
                    <?php endif;?>
                <?php endif;?>

                <?php if(($q_correct[0] == 2 || $q_correct[1] == 2) && ($m_correct[0] == 2 || $m_correct[1] == 2)):?>
                    <div class="option-item activeA  clearfix" data-eq="2" data-option="B">
                        <span class="layui-icon right">&#xe605;</span>
                        <p class="option-text"><?=$v['option_b']?></p>
                    </div>
                <?php else:?>
                    <?php if($m_correct[0] == 2 || $m_correct[1] == 2):?>
                        <div class="option-item activeW  clearfix" data-eq="2" data-option="B">
                            <span class="layui-icon wrong">&#x1006;</span>
                            <p class="option-text"><?=$v['option_b']?></p>
                        </div>
                    <?php else:?>
                        <div class="option-item clearfix" data-eq="2" data-option="B">
                            <span class="option-serial">B、</span>
                            <p class="option-text"><?=$v['option_b']?></p>
                        </div>
                    <?php endif;?>
                <?php endif;?>

                <?php if(($q_correct[0] == 3 || $q_correct[1] == 3 || $q_correct[2] == 3) && ($m_correct[0] == 3 || $m_correct[1] == 3 || $m_correct[2] == 3)):?>
                    <div class="option-item activeA  clearfix" data-eq="3" data-option="C">
                        <span class="layui-icon right">&#xe605;</span>
                        <p class="option-text"><?=$v['option_c']?></p>
                    </div>
                <?php else:?>
                    <?php if($m_correct[0] == 3 || $m_correct[1] == 3 || $m_correct[2] == 3):?>
                        <div class="option-item activeW  clearfix" data-eq="3" data-option="C">
                            <span class="layui-icon wrong">&#x1006;</span>
                            <p class="option-text"><?=$v['option_c']?></p>
                        </div>
                    <?php else:?>
                        <div class="option-item clearfix" data-eq="3" data-option="C">
                            <span class="option-serial">C、</span>
                            <p class="option-text"><?=$v['option_c']?></p>
                        </div>
                    <?php endif;?>
                <?php endif;?>

                <?php if(($q_correct[0] == 4 || $q_correct[1] == 4 || $q_correct[2] == 4 || $q_correct[3] == 4) && ($m_correct[0] == 4 || $m_correct[1] == 4 || $m_correct[2] == 4 || $m_correct[3] == 4)):?>
                    <div class="option-item activeA  clearfix" data-eq="4" data-option="D">
                        <span class="layui-icon right">&#xe605;</span>
                        <p class="option-text"><?=$v['option_d']?></p>
                    </div>
                <?php else:?>
                    <?php if($m_correct[0] == 4 || $m_correct[1] == 4 || $m_correct[2] == 4 || $m_correct[3] == 4):?>
                        <div class="option-item activeW  clearfix" data-eq="4" data-option="D">
                            <span class="layui-icon wrong">&#x1006;</span>
                            <p class="option-text"><?=$v['option_d']?></p>
                        </div>
                    <?php else:?>
                        <div class="option-item clearfix" data-eq="4" data-option="D">
                            <span class="option-serial">D、</span>
                            <p class="option-text"><?=$v['option_d']?></p>
                        </div>
                    <?php endif;?>
                <?php endif;?>
            </li>
            <?php endforeach;?>
        </ul>
    </div>
</div>

<div id="app" style="display: none;">
    <p v-cloak>{{info.data.message}}</p>
</div>

<?php include COMMON_PATH.'/index/footer.html' ?>

<script src="https://cdn.jsdelivr.net/vue/latest/vue.js"></script>

<script>
    navActive(1);

    $(function(){

        var demo = new Vue({
            el: '#app',
            data: {
                info: {}
            },
            mounted: function() {
                this.getCustomers();
            },
            methods: {
                getCustomers: function() {
                    // 定义vm变量，让它指向this,this是当前的Vue实例
                    var
                        vm = this,
                        callback = function(result) {
                            // 由于函数的作用域，这里不能用this
//                            vm.$set( info, result );
                            vm.info = result;
                        };

                    var param = {
                        url: 'http://192.168.1.111:8030/v003/Question/results',
                        data:{
                            llid: 5,
                            token: 'CTwJbAA9DWNUbQM2D2ZSOQA3BjcCYQ=='
                        }
                    };
                    $.ajax({
                        type: "post",
                        url: param.url,
                        datatype: "JSON",
                        data: param.data,
                        success: function (obj) {
                            var result = $.parseJSON(obj);
                            console.log(result);
                            callback(result);
                        }
                    });

                }
            }
        });

    });
</script>
</html>



















